package com.reyco1.data
{
	public class Collection extends DataProvider
	{
		private var _iterator:Iterator;
		
		public function Collection(value:*=null)
		{
			super(value);
			_iterator = new Iterator(this);
		}
		
		/* methods */
		
		public function hasNext():Boolean
		{
			return _iterator.hasNext();
		}
		
		public function hasPrevious():Boolean
		{
			return _iterator.hasPrevious();
		}
		
		public function next():Object
		{
			return _iterator.next();
		}
		
		public function previous():Object
		{
			return _iterator.previous();
		}
		
		public function flush():void
		{
			data = [];
			iterator.cursor = 0;
		}

		/* properties */
		
		public function get iterator():Iterator
		{
			return _iterator;
		}

	}
}